package com.cloud.provider.web.frontend;

import com.cloud.base.dto.BaseQuery;
import com.cloud.core.support.BaseController;
import com.cloud.provider.model.dto.CartPageQuery;
import com.cloud.provider.model.dto.OrderPageQuery;
import com.cloud.provider.service.OmcCartService;
import com.cloud.wrapper.WrapMapper;
import com.cloud.wrapper.Wrapper;
import com.github.pagehelper.PageInfo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * The class Omc cart controller.
 */
@RestController
@RequestMapping(value = "/cart")
@Api(value = "WEB - OmcCartController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class OmcCartController extends BaseController {

	@Resource
	private OmcCartService omcCartService;


	@PostMapping("queryCartListWithPage")
	@ApiOperation(httpMethod = "POST", value = "查询购物车列表")
	public Wrapper queryCartListWithPage(@RequestBody CartPageQuery cartPageQuery) {
		PageInfo pageInfo = omcCartService.queryCartListWithPage(cartPageQuery);
		return WrapMapper.ok(pageInfo);
	}

}
